package com.lx.apk.encrypt.utils;

import java.io.File;

/**
 *
 * date 2020/8/7.
 * description： 签名工具类
 */
public class SignUtils {
    public static void signature(File unSignApk, File signApk) {
        if (unSignApk == null || !unSignApk.exists()) {
            LogUtils.e("The APK that needs to be signed does not exist");
            return;
        }
        String command = "cmd.exe /C jarsigner -sigalg SHA1withRSA -digestalg SHA1 " +
                "-keystore C:/Users/Administrator/.android/debug.keystore -storepass android -keypass android " +
                "-signedjar " + signApk.getAbsolutePath() + " " + unSignApk.getAbsolutePath() + " androiddebugkey";

        CmdUtils.execCommand(command);
    }
}
